package main.start;

import java.util.ArrayList;
import java.util.List;

import logic.common.game.GameMode;
import main.GameCycle;
import main.InitGame;
import ai.AILevel;

public abstract class GameStartPolicy extends StartPolicy {
	
	public GameStartPolicy(String[] args) {
		super(args);
	}
	
	@Override
	public void performStart() {
		List<String> scenarios = new ArrayList<String>();
		scenarios.add(args[0]);
		int respawn = getInt(args[1]);
		int countDown = getInt(args[2]);
		int maxPlayers = getInt(args[3]);
		boolean botsEnabled = getBool(args[4]);
		String gameName = args[5];
		
		GameMode gameMode = GameMode.valueOf(args[6]);
		
		String ip = InitGame.get().getThisIP();
		int scoreLimit = getScoreLimit();
		int tickets = getTickets();
		boolean isOnline = getOnline();
		
		GameCycle gameCycle = new GameCycle(scenarios, respawn, countDown, maxPlayers, botsEnabled, 
				AILevel.Easy, gameName, ip, isOnline, gameMode, scoreLimit, tickets, false, true);
		InitGame.get().initNewGame(true, gameCycle);
	}
	
	public int getScoreLimit() { return 0; }
	
	public int getTickets() { return 0; }
	
	public abstract boolean getOnline();
}